As digital video becomes more common, images are usually encoded so as to increase transmission rate and the amount of data that can be stored, where decoding is conducted to convert the encoded data back to the original images.
In encoding, discrete cosine transform is usually used to transform spatial domain data into frequency domain data. Subsequently, the frequency domain data undergo quantization and entropy coding so as to eventually result in the encoded data. On the other hand, during decoding, the encoded data are first de-quantized, and then inverse discrete cosine transform is used to transform the de-quantized frequency domain data into spatial domain data. However, if the data are over-quantized during encoding, several false edges will appear near the real contrast edges of the images obtained after decoding. This is also known as ringing noise. When the false edges move with time, mosquito noise occurs.
Referring to FIG. 1, U.S. Pat. No. 5,920,356 discloses a post-processor 300, which is capable of removing mosquito noise in decoded images. The post-processor 300 receives a current frame Pn, and comprises a digital noise reduction unit 310, an artifact reduction unit 350, and a frame memory unit 301. The artifact reduction unit 350 includes an edge-detecting circuit 320, a control circuit 315, and a filter circuit 330. The frame memory unit 301 stores a processed reference frame Fn-1 therein.
First, the digital noise reduction unit 310 compares the difference between pixels of every block in current frame Pn and corresponding pixels located at the same locations in the reference frame Fn-1, so as to generate a set of noise-reduced blocks. When the pixel difference is small, the pixel difference is regarded as noise and is attenuated. Otherwise, the pixel difference is regarded as a signal and is not attenuated.
The digital noise reduction unit 310 also compares the blocks located at the same locations in the two frames Pn, Fn-1, to determine a specific block is unchanged or not and to generate a corresponding replenished block flag Rb. When all of the pixel differences in a block are small, the block is regarded as a replenished block (i.e., unchanged block), and the replenished block flag Rb is set. Otherwise, the block is regarded as a non-replenished block, and the replenished block flag Rb is cleared.
After the digital noise reduction unit 310 finishes generating the noise-reduced blocks, with their replenished block flags Rb correctly marked, the artifact reduction unit 350 proceeds to process the noise-reduced blocks.
For each noise-reduced block, the edge-detecting circuit 320 generates a set of edge pixel flags, an edge block flag Eb, and a texture block flag Tb. When a pixel is located on an edge, the pixel is regarded as an edge pixel, and the edge pixel flag thereof is set. Otherwise, the pixel is regarded as a non-edge pixel, and the edge pixel flag thereof is cleared. When a block has several edge pixels, the block is regarded as an edge block, and the edge block flag Eb is set. Otherwise, the edge block flag Eb is cleared.
When a pixel is located on a texture and is not an edge pixel, the pixel is regarded as a texture pixel. When a block has several texture pixels, the block is regarded as a texture block, and the texture block flag Tb is set. Otherwise, the texture block flag Tb is cleared.
After the edge block flag Eb and the texture block flag Tb of a noise-reduced block are correctly marked, the control circuit 315 proceeds to operate.
For a noise-reduced block, when the replenished block flag Rb and the texture block flag Tb are set, and the edge block flag Eb is cleared (i.e., when the noise-reduced block is a replenished, texture, and non-edge block), the control circuit 315 electrically connects the digital noise reduction unit 310 to the frame memory unit 301 and to an output bus 302 of the post-processor 300 so as to output the noise-reduced block. Otherwise, the control circuit 315 electrically connects the filter circuit 330 to the frame memory unit 301 and to the output bus 302 of the post-processor 300 so as to output filtered result of the noise-reduced block.
Based on the edge pixel flag of each pixel in the noise-reduced block, and the edge pixel flags of pixels located within a particular range around that pixel, the filter circuit 330 classifies that pixel into one of an edge pixel, an edge boundary pixel, and a shade pixel. When the pixel is an edge pixel, the filter circuit 330 does not filter the pixel. When the pixel is an edge boundary pixel, the filter circuit 330 performs one-dimensional filtering on the pixel. Further, when the pixel is a shade pixel, the filter circuit 330 performs two-dimensional filtering on the pixel.
For a liquid-crystal display, when its liquid crystal response time is too long, after-images will be generated at the edges of moving objects so as to cover the mosquito noise. In addition, when the moving rate of the images is faster than the response rate of the liquid crystals, the image data cannot be displayed. Since the conventional post-processor 300 does not take into account the response time of the liquid crystal display, filtering is still performed on the mosquito noise that are covered by the after-images and that cannot be displayed, thereby slowing down the processing speed.